package com.dianning.service.task;

import java.util.*;

import org.apache.commons.logging.*;

import com.dianning.exception.DianningException;
import com.dianning.service.InfoService;

public class TopInfoTimerTask
    extends TimerTask {

  private static final Log logger = LogFactory.getLog(TopInfoTimerTask.class);

  private InfoService infoService;


  public TopInfoTimerTask() {
  }

  /**
   * When an object implementing interface <code>Runnable</code> is used to create a thread, starting the
   * thread causes the object's <code>run</code> method to be called in that separately executing thread.
   *
   * @todo Implement this java.lang.Runnable method
   */
  public void run() {
      logger.info("Top Info start...");
      logger.info("City Top");
      this.getInfoService().updateCityTopInfo();
      logger.info("Area Top");
      this.getInfoService().updateAreaTopInfo();
      logger.info("Commend Top");
      this.getInfoService().updateCommendInfo();
      logger.info("Reserves Top");
      this.getInfoService().updateTopReserves();
      logger.info("Top Info end");
  }

	public InfoService getInfoService() {
		return infoService;
	}
	
	public void setInfoService(InfoService infoService) {
		this.infoService = infoService;
	}

}
